import Vue from 'vue'
import Router from 'vue-router'
import login from '@/view/user/login/login'
import choose from '@/view/user/login/choose'

//用户首页
import index from '@/view/user/index/index'
import hot from '@/view/user/index/hot'
import new1 from '@/view/user/index/new'

//用户查看主播页面
import anchor from '@/view/user/anchor/anchor'

//用户消息页面
import message from '@/view/user/message/message'
import all from '@/view/user/message/all'
import follow from '@/view/user/message/follow'

//用户页面我的
import my from '@/view/user/index/my'
import mineSetting from '@/view/user/index/mine_setting'

//主播首页
import anchor_index from '@/view/anchor/index/index';

//主播消息页面
import anchor_message from '@/view/anchor/message/message'
import anchor_message_all from '@/view/anchor/message/all'
import anchor_message_like from '@/view/anchor/message/like'

//主播排行榜页面
import anchor_ranking from '@/view/anchor/ranking/ranking'
import anchor_ranking_liuliu from '@/view/anchor/ranking/liuliu'
import anchor_ranking_gift from '@/view/anchor/ranking/gift'
import anchor_ranking_fans from '@/view/anchor/ranking/fans'

Vue.use(Router)


export default new Router({
  routes: [
    {
      path: '/',
      name: 'login',
      meta: {
        title: '登陆'
      },
      component: login
    },
    {
      path: '/choose',
      name: 'choose',
      meta: {
        title: '选择身份'//暂时用路由后面再改成弹窗
      },
      component: choose
    },
    {
      path: '/index',
      name: 'index',
      component: index,
      meta: {//后面再将热门和最新合成一个页面
        title: '用户首页'
      },
      redirect: '/index/hot',
      children: [
        {
          path: '/index/new1',
          meta: {
            title: '最新'
          },
          component: new1
        },
        {
          path: '/index/hot',
          meta: {
            title: '热门'
          },
          component: hot
        }
      ]
    },
    {
      path: '/index/anchor/:id',
      meta: {
        title: '查看主播'
      },
      name: 'anchor',
      component: anchor
    },
    {
      path: '/message',
      name: 'message',
      meta: {
        title: '用户消息'
      },
      component: message,
      redirect: '/message/all',
      children: [
        {
          path: '/message/all',
          meta: {
            title: '消息'
          },
          component: all
        },
        {
          path: '/message/follow',
          meta: {
            title: '关注'
          },
          component: follow
        }
      ]
    },
    {
      path: '/my',
      name: 'my',
      meta: {
        title: '我的'
      },
      component: my
    },
    //主播
    {
      path: '/anchor/index',
      name: 'anchor',
      component: anchor_index,
    },
    {
      path: '/anchor/message',
      name: 'anchor_message',
      meta: {
        title: '主播消息'
      },
      component: anchor_message,
      redirect: '/anchor/message/all',
      children: [
        {
          path: '/anchor/message/all',
          meta: {
            title: '消息'
          },
          component: anchor_message_all
        },
        {
          path: '/anchor/message/like',
          meta: {
            title: '喜欢'
          },
          component: anchor_message_like
        }
      ]
    },
    {
      path: '/anchor/ranking',
      name: 'ranking',
      meta: {
        title: '主播排行榜'
      },
      component: anchor_ranking,
      redirect: '/anchor/ranking/liuliu',
      children: [
        {
          path: '/anchor/ranking/gift',
          meta: {
            title: '礼物排行榜'
          },
          component: anchor_ranking_gift
        },
        {
          path: '/anchor/ranking/liuliu',
          meta: {
            title: '溜溜排行榜'
          },
          component: anchor_ranking_liuliu
        },
        {
          path: '/anchor/ranking/fans',
          meta: {
            title: '粉丝排行榜'
          },
          component: anchor_ranking_fans
        }
      ]
    },
    {
      path: '/mineSetting',
      name: 'mineSetting',
      component: mineSetting
    },
  ]
})
